package com.hiyee.api.controller.customer;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.hiyee.annotation.CurrentCustomer;
import com.hiyee.annotation.JwtVerify;
import com.hiyee.pojo.auth.LoginCustomer;
import com.hiyee.response.ResponseJsonResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 商品相关接口
 *
 * @author WangBin
 */
public interface GoodsControllerApi {
    /**
     * 获取首页 H5 分类
     *
     * @return Object
     */
    @GetMapping("/category/getH5Tree")
    public ResponseJsonResult getH5Tree() throws JsonProcessingException;

    /**
     * 获取客户商品列表
     *
     * @return Object
     */
    @GetMapping("/goods/list")
    @JwtVerify
    public ResponseJsonResult searchGoods(
            @RequestParam(required = true,value = "sort_by") String sortBy,
            @RequestParam(required = true, value = "sort_type") String sortType,
            @RequestParam(required = false, value = "category_id", defaultValue = "0") Integer categoryId,
            @RequestParam(required = false, value = "name", defaultValue = "") String name,
            @RequestParam(required = false, value = "page", defaultValue = "1") Integer page,
            @RequestParam(required = false, value = "page_size", defaultValue = "20") Integer pageSize,
            @CurrentCustomer LoginCustomer loginCustomer);

    /**
     * 获取客户商品详情
     *
     * @return Object
     */
    @GetMapping("/goods/get")
    @JwtVerify
    public ResponseJsonResult getGoods(
            @RequestParam(required = true,value = "goods_id") Long goodsId,
            @CurrentCustomer LoginCustomer loginCustomer);

    /**
     * 获取商品的服务列表
     *
     * @param Long goodsId
     * @return ResponseJsonResult
     */
    public ResponseJsonResult getServiceList(@RequestParam(required = true, value = "goods_id") Long goodsId);
}
